#ifndef _DEV_STATIC_H_
#define _DEV_STATIC_H_

#include "common/common.h"
#include "json/json-usr.h"
#include "device/dev_common.h"


namespace iecas_ns
{
    #define ORIGINAL_DEV "original_dev"
    #define GET_USB_DEV_SH_FILE_NAME "shell/get-usb-dev.sh"
    #define IGNORE_USB_DEV_TXT_FILE_NAME "txt/ignore-usb-dev.txt"
    #define CONNECTED_USB_DEV_TXT_FILE_NAME "txt/connected-usb-dev.txt"

    class CDevStatic
    {
		public:
			static shared_ptr<CDevStatic> getInstance();
            CDevStatic();
			bool init(void);
            void start(void);
		private:
			static shared_ptr<CDevStatic> sm_intancePtr;
            Value m_port_fd;
            shared_ptr<CCommon> m_commonPtr;
            shared_ptr<CJsonUsr> m_jsonUsrPtr;
            shared_ptr<CDevCommon> m_devCommonPtr;
            mutex m_deviceLock;
            vector<string> m_uninitDev;
            void loop(void);
            bool get_original_dev(void);
            void get_connected_usb_dev(void);
            void staticJudge(void);
            string pwd_shell;
    };
}

#endif